import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login'
Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    redirect: "/login"
  },
  {
    path: "/login",
    name:"Login",
    component: Login
  },
  {
    path: "/home",
    name: "Home",
    component: ()=>import("../views/Home.vue"),
    children:[
      {
        path:"/home",
        component: ()=>import("../views/host/Host")
      },
      {
        path: "/cookmenu/list",
        component: ()=>import("../views/cookmenu/CookMenu")
      },
      {
        path: "/cookstyle/list",
        component: ()=>import("../views/cookstyle/CookStyle")
      },
      {
        path: "/order/list",
        component: ()=>import("../views/order/Orders")
      },
      {
        path: "/order/AllOrders",
        component: ()=>import("../views/order/AllOrders")
      },
      {
        path: "/restaurant/list",
        component: ()=>import("../views/restaurant/Restaurant")
      },
      {
        path: "/user/businessmanCheck",
        component: () => import("../views/user/BusinessmanCheck")
      },
      {
        path: "/message/list",
        component: ()=>import("../views/message/Message")
      },
      {
        path: "/user/list",
        component: ()=>import("../views/user/User")
      },
      {
        path: "/user/manager",
        component: ()=>import("../views/user/Manager")
      },
      {
        path: "/shopcar/car",
        component: ()=>import("../views/shopcar/shopcar")
      },
      {
        path: "/cookcheck/list",
        component: ()=>import("../views/cookcheck/Cookcheck")
      },
      {
        path: "/ordercheck/list",
        component: ()=>import("../views/cookcheck/Ordercheck")
      },
      {
        path: "/statistic/list",
        component: ()=>import("../views/statistic/Statistic")
      },
      {
        path: "/info",
        component: ()=>import("../views/Info")
      },
      {
        path: "/permission/permission",
        component: ()=>import("../views/permission/updatePermission")
      },
      {
        path: "/collect/collect",
        component: ()=>import("../views/collect/Collect")
      },
      {
        path: "/host/host",
        component: () =>import("../views/host/Host")
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
